import request from '@/axios';

//顶部导航栏消息
export const topList = () => {
  return request({
    url: '/notify/message/my/topList',
    method: 'get',
  });
};

//我接收的消息 分页
export const queryMyMessage = (current, size, params) => {
  return request({
    url: '/notify/message/my/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    },
  });
};

//我发送的消息 分页
export const mySendList = (current, size, params) => {
  return request({
    url: '/notify/message/my/sendList',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    },
  });
};

//我发送的消息 详情
export const getSendDetail = id => {
  return request({
    url: '/notify/message/sendDetail',
    method: 'get',
    params: {
      id,
    },
  });
};

//我接收的消息 详情
export const getDetail = id => {
  return request({
    url: '/notify/message/detail',
    method: 'get',
    params: {
      id,
    },
  });
};

//删除我接受的消息
export const remove = ids => {
  return request({
    url: '/notify/message/remove',
    method: 'post',
    params: {
      ids,
    },
  });
};

//发送消息
export const add = row => {
  return request({
    url: '/notify/message/save',
    method: 'post',
    data: row,
  });
};

//全部标记已读
export const readAll = () => {
  return request({
    url: '/notify/message/readAll',
    method: 'post',
  });
};

//获取字典内容
export const getDict = code => {
  return request({
    url: '/system/dict/dictionary?code=' + code,
    method: 'get',
  });
};

//获取人员列表
export const getUserList = () => {
  return request({
    url: '/system/user/user-list',
    method: 'get',
  });
};
